<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>固定在头部的进度条</title>
    <style>
      .loading {
        width: 100%;
        height: 100%;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 1000;
        background: #fff;
      }
      .loading .pic {
        height: 4px;
        width: 0%;
        position: absolute;
        top: 0;
        left: 0;
        background-color: green;
      }
      img {
        margin-bottom: 30px;
        margin-left: 5vw;
        height: 90vh;
        width: 90vw;
        display: block;
        border: 3px solid #000;
      }
    </style>
    <script type="text/javascript" src="js/jquery.js"></script>
  </head>
  <body>
    <div class="loading">
      <div class="pic"></div>
    </div>
    <header>
      <img src="https://github.com/CruxF/IMOOC/blob/master/ProImages/ImgPreloading01.jpg?raw=true" />
    </header>
    <script>
      $(".loading .pic").animate({
        width: "20%"
      }, 100);
    </script>

    <section class="one">
      <img src="https://github.com/CruxF/IMOOC/blob/master/ProImages/ImgPreloading02.jpg?raw=true" />
    </section>
    <script>
      $(".loading .pic").animate({
        width: "40%"
      }, 100);
    </script>

    <section class="two">
      <img src="https://github.com/CruxF/IMOOC/blob/master/ProImages/ImgPreloading03.jpg?raw=true" />
    </section>
    <script>
      $(".loading .pic").animate({
        width: "60%"
      }, 100);
    </script>

    <section class="three">
      <img src="https://github.com/CruxF/IMOOC/blob/master/ProImages/ImgPreloading04.jpg?raw=true" />
    </section>
    <script>
      $(".loading .pic").animate({
        width: "80%"
      }, 100);
    </script>

    <section class="four">
      <img src="https://github.com/CruxF/IMOOC/blob/master/ProImages/ImgPreloading05.jpg?raw=true" />
    </section>
    <script>
      $(".loading .pic").animate({
        width: "90%"
      }, 100);
    </script>

    <footer>
      <img src="https://github.com/CruxF/IMOOC/blob/master/ProImages/ImgPreloading06.jpg?raw=true" />
    </footer>
    <script>
      $(".loading .pic").animate({
        width: "100%"
      }, 100, function() {
        $(".loading").fadeOut();
      });
    </script>
  </body>
</html>